/**
 * 
 */
package br.com.rodolfo.timesheet.controller.util;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import br.com.rodolfo.timesheet.controller.BaseController;

/**
 * @author rjulio
 *
 */
@ManagedBean(name = "dataController")
@SessionScoped
public class DataController extends BaseController implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8922293321976369075L;
	/**
	 * @param args
	 */
	private Date hoje  = Calendar.getInstance().getTime();
	private String formatada;
	


	public String getFormatada() {
		formataData(this.hoje);
		return formatada;
	}

	public void setFormatada(String formatada) {
		this.formatada = formatada;
	}
	
	private void formataData(Date d){
		SimpleDateFormat mascara = new SimpleDateFormat("dd/MM/YYY");
		this.formatada = mascara.format(d);
	}

	public Date getHoje() {
		return hoje;
	}

	public void setHoje(Date hoje) {
		this.hoje = hoje;
	}

}
